﻿<UserControl x:Class="Hisaab.Client.Modules.Core.Account.View.Accounts"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Account="clr-namespace:Hisaab.Client.Modules.Core.Account"
             xmlns:View="clr-namespace:Hisaab.Client.Modules.Core.Account.View"
             xmlns:Helpers="clr-namespace:Hisaab.Client.Common.Helpers;assembly=Hisaab.Client.Common"
             Helpers:RibbonTabVisibilityBehaviour.ContextualGroup="{Binding ElementName=cmAccount, Mode=OneWay}"
             Helpers:RibbonTabVisibilityBehaviour.IsVisible="{Binding IsActive, Converter={StaticResource VisibilityConverter}}"
             mc:Ignorable="d" d:DesignHeight="307" d:DesignWidth="309" >
    <UserControl.Resources>
        <Account:AccountTemplateSelector x:Key="accountTemplateSelector"/>
        <DataTemplate x:Key="accountSummaryView">
            <View:AccountSummaryView />
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250" />
            <ColumnDefinition Width="4" />
            <ColumnDefinition Width="122*" />
        </Grid.ColumnDefinitions>
        <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" Name="gridSplitter1" VerticalAlignment="Stretch" Grid.RowSpan="5" />
        <ListBox ItemsSource="{Binding Path=Accounts}" Grid.RowSpan="5" SelectedItem="{Binding SelectedAccount, Mode=TwoWay}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock>
                        <TextBlock.Text>
                            <Binding Path="Name" />
                        </TextBlock.Text>
                    </TextBlock>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <ContentControl Grid.Column="2" Content="{Binding SummaryViewModel}" ContentTemplateSelector="{StaticResource accountTemplateSelector}"/>
    </Grid>
</UserControl>